@model System.Collections.Generic.IList<Omu.AwesomeDemo.Infra.Dto.FoobarInput>

@{
    ViewBag.Title = "index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

    @Html.ValidationSummary()
    @using (Html.BeginForm())
       {
    <ul class='ae-lookup-list'>
        @for (var i = 0; i < Model.Count; i++)
           {
        <li>
        @Html.HiddenFor(o => o[i].Id)
            <table>
                <tbody>
                    <tr>
                        <td>
                            Name<div class='einput'>
                                @Html.TextBoxFor(o => o[i].Name)
                            </div>
                        </td>
                        <td>
                            Person<div class='einput'>
                                @Html.LookupFor(o => o[i].Person, value:Model[i].Person)</div>
                        </td>
                        <td>
                            Person2<div class='einput'>
                                @Html.LookupFor(o => o[i].Person2, value:Model[i].Person2, controller:"PersonLookup")</div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Show<div class='einput'>
                                @Html.AjaxDropdownFor(m => m[i].Show, value:Model[i].Show)</div>
                        </td>
                        <td>
                            Character<div class="einput">
                                @Html.AjaxDropdownFor(o => o[i].Character, value: Model[i].Character, controller: "PersonAjaxDropdown", parentId: "[" + i + "].Show")</div>
                        </td>
                        <td>
                            Hobby<div class="einput">
                                @Html.AutocompleteFor(o => o[i].Hobby, value: Model[i].Hobby, maxResults: 5, generatePropId:false)
                                @Html.HiddenFor(o => o[i].HobbyId, new {id = "_"+i+"__HobbyId"})
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </li>
        }
    </ul>
    <input type='submit' value='click me' />
    }

